﻿using Manager.Service;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Manager.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class MyController : ControllerBase
    {
        private readonly RabbitMqService _rabbitMqService;
        public MyController(RabbitMqService rabbitMqService)
        {
            _rabbitMqService = rabbitMqService;
        }

        [HttpPost("send")]
        public IActionResult Send(string message)
        {
            _rabbitMqService.SendMessage(message);
            return Ok("Message sent");
        }
    }
}
